﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<SeaBattle.UI.Web.Models.ChildActions.GameListViewModel>" %>
<%  if (Model.Games.Count() != 0)
    {%>



<h4>Current games: </h4>

<table cellspacing="0">
<thead>
    <td>#</td>
    <td>Opponent</td>
    <td>Preset</td>
</thead>

<% foreach (var game in Model.Games)
   {%>
   <tr>
       <td><%: Html.ActionLink(game.Id.ToString(),"Index","Game", new { id = game.Id}, new{})  %></td>
       <td><%: game.Creator.Login == Model.UserLogin ? game.Opponent.Name : game.Creator.Name %></td>
       <td><%: game.Preset %> </td>
   <tr>

<% }
    }%>

</table>